.\" $Id: PAPIF.3,v 1.13 2004/09/29 18:15:17 terpstra Exp $
.TH PAPIF 3 "September, 2004" "PAPI Programmer's Reference" "PAPI"

.SH NAME
PAPIF \- Performance Application Programming Interface (Fortran)

.SH SYNOPSIS
.nf
.B #include "fpapi.h"
.BI "call PAPIF_function_name(" arg1,arg2,...,check" )
.fi


.SH DESCRIPTION
.B Fortran Calling Interface
The PAPI library comes with a specific Fortran library interface. The
Fortran interface covers the complete library with a few minor
exceptions. Functions returning C pointers to structures, such as
.BR PAPI_get_opt(3)
and
.BR PAPI_get_executable_info(3)
, are either not implemented in the Fortran interface, or implemented with
different calling semantics.

Semantics for specific functions in the Fortran interface are
documented on the equivalent C man page. For example, the semantics
and functionality of
.B PAPIF_accum
are covered in the 
.BR PAPI_accum(3)
man page.

For most architectures the following relation holds between the pseudo-types
listed and Fortran variable types.

.TS
box, tab(!);
c  | c  | c
lt | lt | lt.
Pseuodo-type!Fortran type!Description
C_INT!INTEGER!Default Integer type
C_FLOAT!REAL!Default Real type
C_LONG_LONG!INTEGER*8!Extended size integer
C_STRING!CHARACTER*(PAPI_MAX_STR_LEN)!Fortran string
C_INT FUNCTION!EXTERNAL INTEGER FUNCTION!T{
Fortran function returning integer result 
T}
C_INT(*)!T{
Array of corresponding type
T}!T{
C_TYPE(*) refers to an array of the corresponding Fortan type.
The length of the array needed is context dependent. It may be 
e.g. PAPI_MAX_HWCTRS or PAPIF_num_counters.
T}
C_FLOAT(*)!\^!\^
C_LONG_LONG(*)!\^!\^
.TE


Array arguments must be of sufficent size to hold the input/output
from/to the subroutine for predictable behavior. The array length is
indicated either by the accompanying argument or by internal PAPI
definitions. For details on this see the corresponding C routine.

Subroutines accepting 
.B C_STRING 
as an argument are on most implementations capable of reading the
character string length as provided by Fortran. In these implementations
the string is truncated or space padded as necessary. For other
implementations the length of the character array is assumed to be
of sufficient size. No character string longer than
.B PAPI_MAX_STR_LEN
is returned by the PAPIF interface.

.SH RETURN VALUES
The return code of the corresponding C routine is returned in the argument 
.B check
in the Fortran interface.

.SH SEE ALSO
 The PAPI Interface:  
.BR PAPI(3)
